
const useStore = defineStore(
  'todo',
  {
    state: () => ({
      // 基本资料
      todoData: null,
        approveData: null,
        formData: {},
        applyType: null
    }),
    actions: {
        setTodoData(todoData) {
            this.applyType = todoData.applyType;
            const formData = todoData.formData;

            if (formData) {
                this.formData = formData;
            } else {
                this.formData = {};
            }
            this.todoData = todoData;

        },
        getApplyType() {
          return this.applyType;
        },
        getFormData() {
            return this.formData;
        },
      // 获取用户列表
      getTodoData() {
        return this.todoData;
      },
        setApproveData(data) {
            this.approveData = data;
        }
    }
  })

export default useStore
